home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / SHARED.DIR / 03144_Script_PRINT ALL CARDS 1 < prev    next >
Text File  |  1996-04-01  |  3KB  |  83 lines

  1. -- -----------------------------------------------------------
  2. -- Handler doPrintAllCards 
  3. -- THIS VERSION PRINTS THE FILES USING A REPEAT LOOP AND THE HANDLER
  4. -- getNthFileNameInFolder
  5. --on doPrintAllCards printObj, filePathName
  6. --  printobj(mSetDocumentName, "Leonardo 2")
  7. --  
  8. --  -- set up the new object:
  9. --  -- reset to page 1
  10. --  printobj(mreset)
  11. --  
  12. --  -- set landscape mode
  13. --  printobj(msetlandscapemode, TRUE)
  14. --  
  15. --  set paperwidth = printobj(mgetpaperwidth)
  16. --  set paperheight = printobj(mgetpaperheight)
  17. --  printobj(msetmargins, 0, 0, paperwidth, paperheight)
  18. --  
  19. --  -- set the printable space to the margins
  20. --  printobj(msetprintablemargins)
  21. --  
  22. --  -- set the margins to as big as possible
  23. --  set pageW = printObj(mGetPageWidth)
  24. --  set pageH = printObj(mGetPageheight)
  25. --  
  26. --  -- page footer right side
  27. --  --  printObj(mSetPageNumSymbol,"▐")
  28. --  --  printObj(mSetTextSize,10)
  29. --  --  printObj(mSetTextStyle,"normal")
  30. --  --  printObj(mDrawText, "page ▐", pageW - 10, pageH)
  31. --  
  32. --  set pictureFileList = getPictureFileList()
  33. --  set numPictures = count(pictureFileList)
  34. --  set numPages = numPictures / 4
  35. --  
  36. --  -- register the xobject
  37. --  printObj(mRegister, "PMAT130-013-01075")
  38. --  --  printObj(mSetProgressPict, the picture of cast 3092)
  39. --  
  40. --  repeat with currentPage = 0 to numPages - 1 -- -1 because starting at 0
  41. --    -- start a new page
  42. --    printobj(mnewpage)
  43. --    
  44. --    printobj(mpicture, filePathName & getAt(pictureFileList, currentPage * 4 + 1), 0, 0, pageW / 2, (pageH / 2) - 10)
  45. --    printobj(mpicture, filePathName & getAt(pictureFileList, currentPage * 4 + 2), 0, pageH / 2, pageW / 2, pageH - 10)
  46. --    printobj(mpicture, filePathName & getAt(pictureFileList, currentPage * 4 + 3), pageW / 2, 0, pageW, (pageH / 2) - 10)
  47. --    printobj(mpicture, filePathName & getAt(pictureFileList, currentPage * 4 + 4), pageW / 2, pageH / 2, pageW, pageH - 10)
  48. --    -- print the page
  49. --    printobj(mprint)
  50. --  end repeat
  51. --  
  52. --  -- set up the last page
  53. --  printobj(mnewpage)
  54. --  printobj(mpicture, filePathName & getAt(pictureFileList, numPictures - 2), 0, 0, pageW / 2, (pageH / 2) - 10)
  55. --  printobj(mpicture, filePathName & getAt(pictureFileList, numPictures - 1), 0, pageH / 2, pageW / 2, pageH - 10)
  56. --  printobj(mpicture, filePathName & getAt(pictureFileList, numPictures), pageW / 2, 0, pageW, (pageH / 2) - 10)
  57. --  
  58. --  -- print the last page
  59. --  printobj(mprint)
  60. --  
  61. --  -- get rid of the object
  62. --  printobj(mdispose)
  63. --end 
  64. --
  65. --on getPictureFileList
  66. --  set fileList = []
  67. --      repeat with i = 1 to the maxInteger
  68. --            put getNthFileNameInFolder(the pathName & "prtPicts", i) into n
  69. --            if n = EMPTY then exit repeat
  70. --            append(fileList, n)
  71. --      end repeat
  72. --      return fileList
  73. --end
  74.  
  75. on getPictureFileList
  76.   set fileList = []
  77.       repeat with i = 1 to the maxInteger
  78.             put getNthFileNameInFolder(the pathName & "prtPicts", i) into n
  79.             if n = EMPTY then exit repeat
  80.             append(fileList, n)
  81.       end repeat
  82.       return fileList
  83. end